home *** CD-ROM | disk | FTP | other *** search
- /*
- File: time.h
-
- Contains: Date and time
-
- Version: Technology: StdCLib 3.4
- Release: 3.6d2
-
- Copyright: © 1987-1996 by Apple Computer, Inc., all rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __TIME_H__
- #define __TIME_H__
-
- #ifndef __CONDITIONALMACROS__
- #include <ConditionalMacros.h>
- #endif
-
-
- /*
- * Get common declarations
- */
-
- #ifndef __NULLDEF__
- #include <NullDef.h>
- #endif
- #ifndef __SIZETDEF__
- #include <SizeTDef.h>
- #endif
-
-
- #if PRAGMA_ONCE_SUPPORTED
- #pragma once
- #endif /* PRAGMA_ONCE_SUPPORTED */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #elif PRAGMA_PACK_SUPPORTED
- #pragma pack(push, 2)
- #endif
-
-
-
-
- /*
- * Declarations
- */
-
- #define CLOCKS_PER_SEC 60
- typedef unsigned long clock_t;
- typedef unsigned long time_t;
-
- struct tm {
- int tm_sec; /* Seconds after the minute -- [0, 61] */
- int tm_min; /* Minutes after the hour -- [0, 59] */
- int tm_hour; /* Hours after midnight -- [0, 23] */
- int tm_mday; /* Day of the month -- [1, 31] */
- int tm_mon; /* Months since January -- [0, 11] */
- int tm_year; /* Years since 1900 */
- int tm_wday; /* Days since Sunday -- [0, 6] */
- int tm_yday; /* Days since January 1 -- [0, 365] */
- int tm_isdst; /* Daylight Savings Time flag */
- };
- typedef struct tm tm;
-
-
- /*
- * Time manipulation functions
- */
-
- extern clock_t clock(void );
- /* function */
- #ifndef GENERATINGPOWERPC
- #ifndef __CFM68K__
- #define clock() __tickcount() /* macro - use TickCount() */
- extern pascal unsigned long __tickcount(void )
- ONEWORDINLINE(0xA975);
-
- #endif /* ! defined(__CFM68K__) */
-
- #endif /* ! defined(GENERATINGPOWERPC) */
-
-
- extern double difftime(time_t time1, time_t time0);
- /* function */
- #define difftime(time1,time0) ((long double)time1 - time0) /* macro */
-
- extern time_t mktime(tm *timeptr);
- extern time_t time(time_t *timer);
-
- /*
- * Time conversion functions
- */
-
- extern char *asctime(const tm *timeptr);
- extern char *ctime(const time_t *timer);
- extern tm *gmtime(const time_t *timer);
- extern tm *localtime(const time_t *timer);
- extern size_t strftime(char *s, size_t maxsize, const char *format, const tm *timerptr);
-
- /*
- Re-entrant-safe functions. The functions, "asctime_r",
- "ctime_r", "gmtime_r", and "localtime_r" are safe to
- use in re-entrant situations including preemptive
- 68k threads or preemptive tasks provided by the
- Multiprocessing Library for PowerPC/System 7.
-
- To make the prototypes for these functions visible,
- you must #define _POSIX_THREAD_SAFE_FUNCTIONS 1
- via command-line compiler-directive or equivalent
- option. These functions are not available in versions
- of StdCLib prior to 3.5a1.
- */
-
- #if defined(_POSIX_THREAD_SAFE_FUNCTIONS)
- extern char *asctime_r(const tm *timeptr, char *buf);
- extern char *ctime_r(const time_t *timer, char *buf);
- extern tm *gmtime_r(const time_t *timer, tm *result);
- extern tm *localtime_r(const time_t *timer, tm *result);
- #endif /* defined(_POSIX_THREAD_SAFE_FUNCTIONS) */
-
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #elif PRAGMA_PACK_SUPPORTED
- #pragma pack(pop)
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __TIME_H__ */
-
-